import 'package:flutter/material.dart';
import 'package:flutter_module/global/colors.dart';
import 'package:flutter_screenutil/screen_util.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        //appBar: AppBar(
        //  backgroundColor: Colors.black26,
        //  title: Text('container'),
        //),
        body: OrderConfirm(),
      ),
    );
  }
}
class OrderConfirm extends StatefulWidget {
  OrderConfirm({Key key}) : super(key: key);

  @override
  _OrderConfirmState createState() {
    return _OrderConfirmState();
  }
}

class _OrderConfirmState extends State<OrderConfirm> {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(
      BoxConstraints(
        maxWidth: MediaQuery.of(context).size.width,
        maxHeight: MediaQuery.of(context).size.height
      ),
      designSize: Size(1080,2340),
    );
    return Scaffold(
      backgroundColor:Color(0xff000B1F) ,
      appBar: AppBar(
        backgroundColor: Color(0xff000B1F),
        title: Text(
          '确认订单',
          style:TextStyle(
            color:Colors.white,
          ),
        ),
        centerTitle: true,
        leading: IconButton(
          icon: Icon(Icons.arrow_back,color: Colors.white),
          onPressed: (){
            Navigator.pop(context);
          },
        ),
      ),
      body: Container(
        margin: EdgeInsets.fromLTRB(
          ScreenUtil().setWidth(0),
          ScreenUtil().setHeight(0),
          ScreenUtil().setWidth(0),
          70,
        ),
        padding: EdgeInsets.fromLTRB(
          ScreenUtil().setWidth(30),
          ScreenUtil().setHeight(30),
          ScreenUtil().setWidth(30),
          ScreenUtil().setHeight(0),
        ),
        child: Column(
          children: [
            Container(
              height: ScreenUtil().setHeight(352),
              padding: EdgeInsets.all(ScreenUtil().setHeight(30)),
              decoration: BoxDecoration(
                color: Color(0xff182643),
               borderRadius: BorderRadius.all(Radius.circular(8)),
              ),
              child: Row(
                children: [
                  ClipRRect(
                    borderRadius: BorderRadius.all(Radius.circular(8)),
                    child: Image.network(
                      'http://photogz.photo.store.qq.com/psc?/V54ETsN62Rdw772wFsNq0jEkXI4LU2rF/05RlWl8gsTOH*Z17MtCBzAwS0MxrZm1k*1zjq0ea*xzKT8bI2OfaEDjQx7K*xuaaBcvpJIAE3XnW4QBIWwMRpQ!!/m&bo=xgLRAsYC0QIRADc!&rf=mood_app',
                      fit: BoxFit.fitHeight,
                    ),
                  ),
                  SizedBox(width: ScreenUtil().setWidth(40),),
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: [
                      Text(
                        '城市梦幻人',
                        style:TextStyle(
                          fontSize: ScreenUtil().setSp(45),
                          color:Colors.white70,
                        ),
                      ),

                      Text(
                        '归属人:Elbeau',
                        style:TextStyle(
                          fontSize: ScreenUtil().setSp(34),
                          color:Colors.white70,
                        ),
                      ),
                      Text(
                        '售卖方式:链上商品/无实物',
                        style:TextStyle(
                          fontSize: ScreenUtil().setSp(34),
                          color:Colors.white70,
                        ),
                      ),
                      Text(
                        '账单索引:bill20220324909876543',
                        style:TextStyle(
                          fontSize: ScreenUtil().setSp(34),
                          color:Colors.white70,
                        ),
                      ),
                    ],
                  )
                ],
              ),
            ),
            Container(
              margin: EdgeInsets.fromLTRB(
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(30),
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(0),
              ),
              height: ScreenUtil().setHeight(206),
              width: ScreenUtil().screenWidth-ScreenUtil().setWidth(60),
              padding: EdgeInsets.all(ScreenUtil().setHeight(30)),
              decoration: BoxDecoration(
                color: Color(0xff182643),
                borderRadius: BorderRadius.all(Radius.circular(8)),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    '区块链hash',
                    style:TextStyle(
                      fontSize: ScreenUtil().setSp(45),
                      color:Colors.white70,
                    ),
                  ),
                  Text(
                    'QmPtdoRjb6jTVCmbNJzHUCnJeJQmh3uheBNTdYLqFFFbgD',
                    style:TextStyle(
                      fontSize: ScreenUtil().setSp(35),
                      color:Colors.white70,
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
      bottomSheet: Container(
        height: 70,
        padding: EdgeInsets.fromLTRB(
          ScreenUtil().setWidth(50),
          ScreenUtil().setHeight(0),
          ScreenUtil().setWidth(50),
          ScreenUtil().setHeight(0),
        ),
        color: Color(0xff000B1F),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text.rich(
              TextSpan(
                  children: [
                    TextSpan(
                      text: '总价：',
                      style: TextStyle(
                        color: Colors.white70,
                        fontSize: ScreenUtil().setSp(55),
                      ),
                    ),

                    TextSpan(
                      text: '1.2',
                      style: TextStyle(
                        color: AppColors.primary,
                        fontSize: ScreenUtil().setSp(55),
                      ),
                    ),
                    TextSpan(
                      text: 'Eth',
                      style: TextStyle(
                        color: AppColors.primary,
                        fontSize: ScreenUtil().setSp(40),
                      ),
                    ),
                  ]
              ),
            ),
            InkWell(
              onTap: (){
                Navigator.pushNamed(context, 'pay');
              },
              child: Container(
                width: ScreenUtil().setWidth(404),
                height: ScreenUtil().setHeight(122),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(30)),
                  color: AppColors.primary,
                ),
                child: Center(
                  child: Text(
                    '确认',
                    style:TextStyle(
                      fontSize: ScreenUtil().setSp(50),
                      color:Colors.white,
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}